<template>
  <div>
    <detail-banner :bannerImg="bannerImg" :bannerImgs="gallaryImgs" :sightName="sightName"></detail-banner>
    <detail-header></detail-header>
    <detail-ticket @change="changeshow"></detail-ticket>
    <detail-list :list="list"></detail-list>
    <fade-animation>
      <ticket-reserve v-show="noReserce" @close="changeclose"></ticket-reserve>
    </fade-animation>
  </div>
</template>
<script>
  import DetailBanner from './component/DetailBanner'
  import DetailHeader from './component/DetailHeader'
  import DetailTicket from './component/Ticket'
  import DetailList from './component/list'
  import FadeAnimation from 'comment/fade/FadeAnimation'
  import ticketReserve from './component/Reserve'
  import axios from 'axios'

export default {
  name: 'Detail',
  components: {
    DetailBanner,
    DetailHeader,
    DetailTicket,
    DetailList,
    ticketReserve,
    FadeAnimation
  },
  methods: {
    getDetailInfo () {
      axios.get('./static/homemessage/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then(this.handleGetDataSucc)
    },
    handleGetDataSucc (res) {
      res = res.data;
      if(res.ret && res.data){
        const data = res.data;
        this.sightName = data.sightName;
        this.bannerImg = data.bannerImg;
        this.gallaryImgs = data.gallaryImgs;
        this.list = data.categoryList;

      }
    },
    changeshow () {
     this.noReserce =  true
    },
    changeclose () {
      this.noReserce =  false
    }
  },
  created () {
    this.getDetailInfo()
  },
  data () {
    return {
      list:[],
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      noReserce: false
    }
  }
}
</script>

<style scoped>
 .asd {
   height: 500px;
 }
</style>
